import {
  request
} from '../../request/index.js';
import regeneratorRuntime from '../../lib/runtime/runtime.js'

Page({
  data: {
    navList: [],
    swiperList: [],
    videoList: [],
  },

  async getNavList() { 
    const res = await request({ url: "/navList" });
    this.setData({
      navList:res.data.data.navList
    })
  },
  async getSwiperList() { 
    const res = await request({ url: "/swiperList" });
    this.setData({
      swiperList:res.data.data.swiperList
    })
  },
  async getVideoList() { 
    const res = await request({ url: "/videoList" });
    this.setData({
      videoList:res.data.data.videoList
    })
  },

  //options(Object)
  onLoad: function(options){
    this.getNavList();
    this.getSwiperList();
    this.getVideoList();
  },
  onReady: function(){
    
  },
  onShow: function(){
  },
  onHide: function(){

  },
  onUnload: function(){

  },
  onPullDownRefresh: function(){
    this.setData({
      navList: [],
      swiperList: [],
      videoList: []
    });
    this.getNavList();
    this.getSwiperList();
    this.getVideoList();
    wx.stopPullDownRefresh();
  },
  onReachBottom: function(){

  },
  onShareAppMessage: function(){

  },
  onPageScroll: function(){

  },
  //item(index,pagePath,text)
  onTabItemTap:function(item){

  }
});